package Controller;


import Main.*;
import Static.Static;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.stage.Stage;

import java.net.URL;
import java.sql.SQLException;
import java.util.*;

public class Diagram_Controller implements Initializable {

    @FXML
    private Button 西大门;

    @FXML
    private Button 海棠苑;

    @FXML
    private Button 梧桐苑;

    @FXML
    private Button 雪松苑;

    @FXML
    private Button 筠竹苑;

    @FXML
    private Button 第一食堂;

    @FXML
    private Button 第二食堂;

    @FXML
    private Button 大创;

    @FXML
    private Button 松山湖;

    @FXML
    private Button 体育馆;

    @FXML
    private Button 工业中心;

    @FXML
    private Button 乐业楼;

    @FXML
    private Button 图书馆;

    @FXML
    private Button 敬业楼;

    @FXML
    private Button 求真楼;

    @FXML
    private Button 乐群楼;

    @FXML
    private Button 南大门;

    @FXML
    private Button chaxun;

    @FXML
    private TextField qidian;

    @FXML
    private TextField zhongdian;

    @FXML
    private TextArea zuiduanlujing;

    @Override
    public void initialize(URL location, ResourceBundle resources) {

    }

    public void Get(){
        Static.qidian1 = qidian.getText();
        Static.zhongdian1 = zhongdian.getText();
        String lujing = Dijkstra.Dijkstra1();
        zuiduanlujing.setText(lujing);
    }


    public void XiDaMen(ActionEvent event) throws Exception {
        Stage stage = (Stage) 西大门.getScene().getWindow();
        stage.close();
        West_Door_Main adm = new West_Door_Main();
        Stage s = new Stage();
        adm.start(s);
    }

    public void HaiTangYuan(ActionEvent event) throws Exception {
        Stage stage = (Stage) 海棠苑.getScene().getWindow();
        stage.close();
        HaiTang_Dormitory_Main adm = new HaiTang_Dormitory_Main();
        Stage s = new Stage();
        adm.start(s);
    }

    public void WuTongYuan(ActionEvent event) throws Exception {
        Stage stage = (Stage) 梧桐苑.getScene().getWindow();
        stage.close();
        WuTong_Dormitory_Main adm = new WuTong_Dormitory_Main();
        Stage s = new Stage();
        adm.start(s);
    }

    public void XueSongYuan(ActionEvent event) throws Exception {
        Stage stage = (Stage) 雪松苑.getScene().getWindow();
        stage.close();
        XueSong_Dormitory_Main adm = new XueSong_Dormitory_Main();
        Stage s = new Stage();
        adm.start(s);
    }

    public void JunZhuYuan(ActionEvent event) throws Exception {
        Stage stage = (Stage) 筠竹苑.getScene().getWindow();
        stage.close();
        JunZhu_Dormitory_Main adm = new JunZhu_Dormitory_Main();
        Stage s = new Stage();
        adm.start(s);
    }

    public void DiYiShiTang(ActionEvent event) throws Exception {
        Stage stage = (Stage) 第一食堂.getScene().getWindow();
        stage.close();
        First_Canteen_Main adm = new First_Canteen_Main();
        Stage s = new Stage();
        adm.start(s);
    }

    public void DiErShiTang(ActionEvent event) throws Exception {
        Stage stage = (Stage) 第二食堂.getScene().getWindow();
        stage.close();
        Second_Canteen_Main adm = new Second_Canteen_Main();
        Stage s = new Stage();
        adm.start(s);
    }

    public void DaChuang(ActionEvent event) throws Exception {
        Stage stage = (Stage) 大创.getScene().getWindow();
        stage.close();
        Entrepreneurship_Center_Main adm = new Entrepreneurship_Center_Main();
        Stage s = new Stage();
        adm.start(s);
    }

    public void TiYuGuan(ActionEvent event) throws Exception {
        Stage stage = (Stage) 体育馆.getScene().getWindow();
        stage.close();
        Gymnasium_Main adm = new Gymnasium_Main();
        Stage s = new Stage();
        adm.start(s);
    }

    public void SongShanHu(ActionEvent event) throws Exception {
        Stage stage = (Stage) 松山湖.getScene().getWindow();
        stage.close();
        SongShan_Lake_Main adm = new SongShan_Lake_Main();
        Stage s = new Stage();
        adm.start(s);
    }

    public void GongYeZhongXing(ActionEvent event) throws Exception {
        Stage stage = (Stage) 工业中心.getScene().getWindow();
        stage.close();
        Industrial_Center_Main adm = new Industrial_Center_Main();
        Stage s = new Stage();
        adm.start(s);
    }

    public void LeYeLou(ActionEvent event) throws Exception {
        Stage stage = (Stage) 乐业楼.getScene().getWindow();
        stage.close();
        Leye_Building_Main adm = new Leye_Building_Main();
        Stage s = new Stage();
        adm.start(s);
    }

    public void TuShuGuan(ActionEvent event) throws Exception {
        Stage stage = (Stage) 图书馆.getScene().getWindow();
        stage.close();
        Library_Main adm = new Library_Main();
        Stage s = new Stage();
        adm.start(s);
    }

    public void JingYeLou(ActionEvent event) throws Exception {
        Stage stage = (Stage) 敬业楼.getScene().getWindow();
        stage.close();
        Jingye_Building_Main adm = new Jingye_Building_Main();
        Stage s = new Stage();
        adm.start(s);
    }

    public void QiuZhenLou(ActionEvent event) throws Exception {
        Stage stage = (Stage) 求真楼.getScene().getWindow();
        stage.close();
        Qiuzhen_Building_Main adm = new Qiuzhen_Building_Main();
        Stage s = new Stage();
        adm.start(s);
    }

    public void LeQunLou(ActionEvent event) throws Exception {
        Stage stage = (Stage) 乐群楼.getScene().getWindow();
        stage.close();
        Lequn_Building_Main adm = new Lequn_Building_Main();
        Stage s = new Stage();
        adm.start(s);
    }

    public void NanDaMen(ActionEvent event) throws Exception {
        Stage stage = (Stage) 南大门.getScene().getWindow();
        stage.close();
        South_Door_Main adm = new South_Door_Main();
        Stage s = new Stage();
        adm.start(s);
    }
}

